Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds authentication support for the extension in playground environments #1759

Merged
merged 15 commits into from
Oct 31, 2024

Conversation

pastuxso
Copy link
Contributor

@pastuxso pastuxso commented Oct 25, 2024

Adds authentication support for the extension in playground environments, integrating cloud token validation and enabling token retrieval from callback URLs dispatched by the cloud. Key changes include:

  • Auth Token Handling: Simplified by removing unused refresh token logic, as the access-token has an extended lifespan.
  • Load from Secrets: An instance method now checks tokens against playground secrets, using the cloud endpoint for validation.
  • Callback Integration: Supports token recovery from cloud callback URLs, enhancing seamless access when the user is already Authenticated in the Cloud.

@pastuxso pastuxso force-pushed the cris/playground-support branch 2 times, most recently from 0738dc5 to 9daa1bc Compare October 25, 2024 19:20
Adds authentication support for the extension in playground environments,
integrating cloud token validation and enabling token retrieval from
callback URLs dispatched by the cloud. Key changes include:

	•	Auth Token Handling: Simplified by removing unused refresh token
    logic, as the access token has an extended lifespan.
	•	Token Validation: A static method now checks tokens against
    playground secrets, using the cloud endpoint for validation.
	•	Callback Integration: Supports token recovery from cloud callback
    URLs, enhancing seamless access when the user is already
    authenticaded in the Cloud.
@pastuxso pastuxso force-pushed the cris/playground-support branch from 9daa1bc to da11bcf Compare October 25, 2024 19:35
@pastuxso pastuxso force-pushed the cris/playground-support branch from 5494cbb to 06588b3 Compare October 25, 2024 20:13
@pastuxso pastuxso requested a review from sourishkrout October 25, 2024 20:22
@pastuxso pastuxso marked this pull request as ready for review October 25, 2024 20:22
Copy link
Member

@sourishkrout sourishkrout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as advertised ✅.

However, let's refactor the code according to my review and, if possible, let's add a simple unit test, which should be easier once decoding and auth are broken out. To be clear, the test only needs to test how to wind up with a session, not how to get a valid JWT or what the API will do.

src/extension/provider/statefulAuth.ts Outdated Show resolved Hide resolved
src/extension/provider/statefulAuth.ts Outdated Show resolved Hide resolved
src/extension/provider/statefulAuth.ts Outdated Show resolved Hide resolved
src/extension/provider/statefulAuth.ts Outdated Show resolved Hide resolved
@pastuxso pastuxso requested a review from sourishkrout October 28, 2024 21:37
@sourishkrout sourishkrout self-requested a review October 29, 2024 18:23
.gitignore Outdated Show resolved Hide resolved
Copy link
Member

@sourishkrout sourishkrout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there. Please see comments.

@pastuxso pastuxso requested a review from sourishkrout October 29, 2024 22:31
Copy link
Member

@sourishkrout sourishkrout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path is not working because it's not supposed to concatenate to the extension base. Also, there's no default, which wasn't what I asked for.

@pastuxso pastuxso requested a review from sourishkrout October 31, 2024 12:42
Copy link
Member

@sourishkrout sourishkrout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM

@pastuxso pastuxso merged commit d5698e4 into main Oct 31, 2024
1 check passed
@pastuxso pastuxso deleted the cris/playground-support branch October 31, 2024 23:41
hotpocket pushed a commit to hotpocket/vscode-runme that referenced this pull request Nov 5, 2024
…nts (stateful#1759)

Adds authentication support for the extension in playground environments, integrating cloud token validation and enabling token retrieval from callback URLs dispatched by the cloud. Key changes include:

- **Auth Token Handling:** Simplified by removing unused refresh token logic, as the access-token has an extended lifespan.
- **Load from Secrets:** An instance method now checks tokens against playground secrets, using the cloud endpoint for validation.
- **Callback Integration:** Supports token recovery from cloud callback URLs, enhancing seamless access when the user is already Authenticated in the Cloud.

---------

Co-authored-by: Sebastian Tiedtke <sebastiantiedtke@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants